<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<% String myContext = request.getContextPath(); %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	
<script src= "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<!-- 	<script type="text/javascript">
		$(document).ready(function() {
			$("#loginButton").click(function(){
				var mid = $.trim($("#mid").val());
				if(mid == ""){
					alert('아이디를 입력하세요.');
					$("#mid").focus();
					return ;
				}
				var mpassword = $.trim($("#mpassword").val());
				if(mpassword == ""){
					alert('비밀 번호를 입력하세요.');
					$("#mpassword").focus();
					return ;
				}

				/* var data = $("#loginForm").serialize();
				$.ajax({
					type : "POST" ,
					url : "login.main",
					data : data,
					success: function(result){
						$("#lologin").remove();//어디에 넣을 것인가
						$("#login").html(result);//로로그인에 이페이지를 넣겠다.
					},error: function(request, status, error){
						alert("로그인 실패");
					}
				}); */
			});
		});
	</script> -->
		
	<script type="text/javascript">
		var watermarkmID = "ID를 입력하세요.";
		var watermarkmPassword = "";//"비밀번호를 입력하세요.";
		function init() {
			showWatermark(1);
			showWatermark(2);
		}
		function hideWatermark(mid) {
			var objID = document.getElementById("mid");
			var objPassword = document.getElementById("mpassword");

			switch (mid) {
				case 1:
					if (objID.value == watermarkmID) {
						objID.value = "";
					}
					break;
				case 2:
					if (objPassword.value == watermarkmPassword) {
						objPassword.value = "";
					}
					break;
			}
		}		
		function showWatermark(mid) {
			var objID = document.getElementById("mid");
			var objPassword = document.getElementById("mpassword");
			
			switch (mid) {
				case 1:
					if (objID.value == "") {
						objID.value = watermarkmID;
					}
					break;
				case 2:
					if (objPassword.value == "") {
						objPassword.value = watermarkmPassword;
					}
					break;
			}
		}
	</script>
	
	<script type="text/javascript">
		function home(){
			location.href="<%=myContext%>/startHome.main";
		}
	</script>
</head>
<body>
<!-- onload=init() -->
<div id="lologin">
	<form action="<%=myContext%>/login.main" id="loginForm" name="loginForm" method="post">
	<br>
	<table cellpadding="5" cellspacing="1" bgcolor="#FFFFFF" align="center">
		<tbody>
		<tr>
			<td  width="10" >
				<font size="3" color="gray"><b>I D:</b></font>
			</td>
			<td bgcolor="#FFFFFF">
				<input type="text" id="mid" name="mid" size="20"
					>
			</td>
		</tr>
		</tbody>
		<tbody>
		<tr>
			<td width="10" >
				<font size="3" color="gray"><b>PW:</b></font>
			</td>
			<td bgcolor="#FFFFFF">
				<input type="password" name="mpassword" id="mpassword" size="20" >
			</td>
			
			<td><input type="submit" value="Login" id="loginButton" name="loginButton"></td>
		</tr>
		
		</tbody>	
	</table>
	<table id = smallbutton>
		<tr>
			<td colspan="2" align="right">
				<a href="<%=myContext%>/idFindForm.member"><input type="button" value="아이디찾기" id="checkID"  name="checkID"></a>
			</td>
		
			<td colspan="2" align ="right">
				<a href="<%=myContext%>/insertForm.member"><input type="button"  value="회원가입"></a>
			</td>
		</tr>
	</table>
	</form>
	</div>

<div id="myarea"></div>

</body>
</html>